﻿using System;

namespace ExFlash.Actions
{
    public enum SendMethods : byte
    {
        None = 0,
        GET = 1,
        POST = 2
    }

    public class ActionGetUrl2 : ActionRecord
    {
        public SendMethods SendVarsMethod
        {
            get;
            protected set;
        }

        public Boolean LoadTargetFlag
        {
            get;
            protected set;
        }

        public Boolean LoadVariablesFlag
        {
            get;
            protected set;
        }

        public ActionGetUrl2(ushort len)
            : base((byte)ActionCodes.ActionGetUrl2, len)
        {
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            SendVarsMethod = (SendMethods)reader.ReadInt32(2);
            reader.SkipBits(4);
            LoadTargetFlag = reader.ReadBoolean();
            LoadVariablesFlag = reader.ReadBoolean();

            reader.AlignBits();
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
